﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Squares
{
    class Map
    {
        Tile[,] _MapContents;

        public char this[int i, int j]
        {
            get { if (_MapContents[i, j] == null) _MapContents[i, j] = new Tile();
                  return (char)32;
            }
            set {
                if (_MapContents[i, j] == null) _MapContents[i, j] = new Tile();
                _MapContents[i, j].Content = value;
            }
        }

        public int GetUpperBound(int dimension)
        {
            return _MapContents.GetUpperBound(dimension);
        }

        public Map(int height, int width)
        {
            _MapContents = new Tile[height, width];

        }
    }

    class Tile
    {
        private char _content;

        public char Content
        {
            get { return _content; }
            set { _content = value; }
        }

        public Tile()
        {

        }

        public override string ToString()
        {
            return Content.ToString();
        }
    }
}
